package aug23;

import java.io.*;

public class FileOutputStreamEx {
	public static void main(String[] args) throws FileNotFoundException,IOException{
		FileOutputStream fos = null;
		try{
//			fos = new FileOutputStream("c:\\lam\\io\\fileout.txt");
			fos = new FileOutputStream("c:\\lam\\io\\fileout.txt",true);
			String message = "hello fileoutputstream !!!";
			fos.write(message.getBytes());
			fos.close();
		}catch(FileNotFoundException fnfe){
			fnfe.printStackTrace();
		}catch(IOException ie){
			ie.printStackTrace();
		}finally{
			try{
				if(fos != null) fos.close();
			}catch(IOException ie){
				ie.printStackTrace();
			}
		}
	}
}
